home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 454 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.4 KB

  1. Path: qcd.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How to RUN a program in Unix?
  5. Date: 5 Jan 1996 14:47:51 GMT
  6. Organization: Los Alamos National Laboratory
  7. Distribution: world
  8. Message-ID: <4cjdmn$fk5@newshost.lanl.gov>
  9. References: <4ciiip$150@elaine37.Stanford.EDU>
  10. NNTP-Posting-Host: qcd.lanl.gov
  11.  
  12. In article <4ciiip$150@elaine37.Stanford.EDU>, magical@leland.Stanford.EDU
  13. (Alexander Y. Lin) writes: 
  14. <snip>
  15. |> Now I'm trying to run the progtest program to see if it works! But I can't
  16. |> for my life figure out how! I tried to gdb progtest and then type run, but
  17. |> it just says "program exited normally" without the output. (progtest 
  18. |> prints a lits of words to stdout.)
  19.  
  20. Most likely that it doesn't! It seems like you have a valid program which
  21. does absolutely nothing :-) (Or maybe it did do something, like writing out a
  22. file, which you did not notice).
  23.  
  24. First rule for a beginner: _Never_ assume you know where the problem is. Post
  25. a _small_ _complete_ example, describe what you did, what you expected and
  26. what happened.
  27.  
  28. |> 
  29. |> So my question is, how to run a gcc/makefile compiled program? Also, 
  30.  
  31. Depends on the system. On Unix, just name the program: say `progtest'.
  32.  
  33. |> I understand the .o are object files, but what is progtest*?
  34.  
  35. You need help from some elementary book on the system you are running on: I
  36. strongly suggest you do so immediately. I am assuming you are using some
  37. version of Unix, and that the listing was produced by a command equivalent to
  38. `ls -F'. In that case, _you_ have requested (unknowningly of course) to mark
  39. all executable files with a trailing *, all directories with a trailing /
  40. etc. (In priniciple it is possible that the Makefile really generated
  41. something called 'progtest*', but I find that highly unlikely).
  42.  
  43. Note that the object files are not executable: they need to be `linked'
  44. together with libraries to be runnable. Only the final result of the linking
  45. is.
  46.  
  47. Cheers
  48. Tanmoy
  49. -- 
  50. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  51. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  52. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  53. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  54. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  55. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  56.